namespace UnitTests.Foundation
{
    using System;
    using System.IO;
    using System.Reflection;
    using NUnit.Framework;
    using Ploeh.AutoFixture;

    /// <summary>
    /// Base class for fixtures.
    /// </summary>
    public class BaseTestFixture
    {
        /// <summary>
        /// Gets a new AutoFixture instance to create anonymous / random instances with.
        /// The AutoFixture instance will contain application-wide customizations only.
        /// </summary>
        /// <returns>Ready AutoFixture instance.</returns>
        protected Fixture GetNewAutoFixture()
        {
            var autofixture = new Fixture();
            return autofixture;
        }

        /// <summary>
        /// Gets the local executing path.
        /// </summary>
        /// <returns>Local executing path.</returns>
        protected string GetLocalExecutingPath()
        {
            return new Uri(Path.GetDirectoryName(Assembly.GetExecutingAssembly().CodeBase)).LocalPath;
        }
    }
}